a11y: Add API to update relationsets of cells to their parents
authorBenjamin Otte <otte@redhat.com>
Mon, 24 Mar 2014 14:51:38 +0000 (15:51 +0100)
committerBenjamin Otte <otte@redhat.com>
Mon, 24 Mar 2014 15:38:18 +0000 (16:38 +0100)
gtk/a11y/gtkcellaccessible.c
gtk/a11y/gtkcellaccessibleparent.c
gtk/a11y/gtkcellaccessibleparent.h

index 051abecec271d2b590905ff3f5f0d3777af9d84c..11775e48496d7251a843697d191cdba88bcba00c 100644 (file)
@@ -70,6 +70,27 @@ gtk_cell_accessible_get_index_in_parent (AtkObject *obj)
   return gtk_cell_accessible_parent_get_child_index (GTK_CELL_ACCESSIBLE_PARENT (cell->priv->parent), cell);
 }
 
+static AtkRelationSet *
+gtk_cell_accessible_ref_relation_set (AtkObject *object)
+{
+  GtkCellAccessible *cell;
+  AtkRelationSet *relationset;
+  AtkObject *parent;
+
+  relationset = ATK_OBJECT_CLASS (gtk_cell_accessible_parent_class)->ref_relation_set (object);
+  if (relationset == NULL)
+    relationset = atk_relation_set_new ();
+
+  cell = GTK_CELL_ACCESSIBLE (object);
+  parent = gtk_widget_get_accessible (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell)));
+
+  gtk_cell_accessible_parent_update_relationset (GTK_CELL_ACCESSIBLE_PARENT (parent),
+                                                 cell,
+                                                 relationset);
+
+  return relationset;
+}
+
 static AtkStateSet *
 gtk_cell_accessible_ref_state_set (AtkObject *accessible)
 {
@@ -130,6 +151,7 @@ gtk_cell_accessible_class_init (GtkCellAccessibleClass *klass)
 
   class->get_index_in_parent = gtk_cell_accessible_get_index_in_parent;
   class->ref_state_set = gtk_cell_accessible_ref_state_set;
+  class->ref_relation_set = gtk_cell_accessible_ref_relation_set;
   class->get_parent = gtk_cell_accessible_get_parent;
 }
 
index 821828caddd3084d0c8958b92f3008904d2d1aae..e70191531ff22c3c8cf25d3a3423a99f7cf2031c 100644 (file)
@@ -170,3 +170,20 @@ gtk_cell_accessible_parent_edit (GtkCellAccessibleParent *parent,
   if (iface->edit)
     (iface->edit) (parent, cell);
 }
+
+void
+gtk_cell_accessible_parent_update_relationset (GtkCellAccessibleParent *parent,
+                                               GtkCellAccessible       *cell,
+                                               AtkRelationSet          *relationset)
+{
+  GtkCellAccessibleParentIface *iface;
+
+  g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
+  g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (cell));
+  g_return_if_fail (ATK_IS_RELATION_SET (relationset));
+
+  iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
+
+  if (iface->update_relationset)
+    (iface->update_relationset) (parent, cell, relationset);
+}
index 5528f75aee4ea1793da68579b976d4ad6e64a91b..b928e733d9ba980e7e9e962ea5e8c5b8689d9501 100644 (file)
@@ -71,6 +71,10 @@ struct _GtkCellAccessibleParentIface
                                  GtkCellAccessible       *cell);
   void     ( *edit)             (GtkCellAccessibleParent *parent,
                                  GtkCellAccessible       *cell);
+  /* end of actions */
+  void     ( *update_relationset) (GtkCellAccessibleParent *parent,
+                                 GtkCellAccessible       *cell,
+                                 AtkRelationSet          *relationset);
 };
 
 GDK_AVAILABLE_IN_ALL
@@ -107,6 +111,10 @@ void     gtk_cell_accessible_parent_activate         (GtkCellAccessibleParent *p
 GDK_AVAILABLE_IN_ALL
 void     gtk_cell_accessible_parent_edit             (GtkCellAccessibleParent *parent,
                                                       GtkCellAccessible       *cell);
+GDK_AVAILABLE_IN_3_12
+void     gtk_cell_accessible_parent_update_relationset (GtkCellAccessibleParent *parent,
+                                                      GtkCellAccessible       *cell,
+                                                      AtkRelationSet          *relationset);
 
 G_END_DECLS